<script setup>
import { usePermissionStore } from '@/store/index.js'

defineProps({
  defaultActive: String,
})

const permissionStore = usePermissionStore()
</script>

<template>
  <el-menu
    :router="true"
    :default-active="defaultActive || permissionStore.activeTopMenu"
    class="us"
    mode="horizontal"
  >
    <el-menu-item
      v-for="item in permissionStore.topMenus"
      :key="item.path"
      :index="item.path"
    >
      {{ item.meta?.title }}
    </el-menu-item>
  </el-menu>
</template>

<style scoped>
.el-menu.el-menu--horizontal {
  border: none;
}
</style>
